import request from '@/utils/request'

// 获取表单 ｜｜ 搜索表单
export const searchWarehouseInfo = params => request({
  url: '/api/area/pageDetail',
  params
})

// 获取新增库区编号
export const getAddWarehouseId = () => request({
  url: '/api/codeFactory/next/KQ'
})

// 获取所有仓库
export const getWarehouseInfo = params => request({
  url: '/api/warehouse/list',
  params
})

// 新增库区信息
export const addReservoirAreaInfo = data => request({
  url: '/api/area',
  method: 'POST',
  data
})

// 获取修改库区的信息
export const inquireReservoirAreaInfo = id => request({
  url: `/api/area/${id}`
})

// 修改库区信息
export const putReservoirAreaInfo = data => request({
  url: '/api/area',
  method: 'PUT',
  data
})

// 删除库区信息 /api/area?ids[]=
export const delReservoirAreaInfo = id => request({
  url: `/api/area?ids[]=${id}`,
  method: 'DELETE'
})
